package com.cloudfun.campusshare.common.model.dto;

import com.cloudfun.campusshare.common.constant.BidStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;

/**
 * Created by Huqin on 2020/4/8
 */
@Data
@ApiModel(value = "招标信息创建DTO")
public class BidCreateDTO {

    @ApiModelProperty("名称")
    @NotEmpty(message = "名称不能为空", groups = {Create.class})
    @Length(max = 50, message = "名称限制50个字符")
    private String name;

    @ApiModelProperty("来源网站名称")
    @NotEmpty(message = "来源网站名称不能为空", groups = {Create.class})
    @Length(max = 50, message = "来源网站名称限制50个字符")
    private String srcSiteName;

    @ApiModelProperty("来源网站地址")
    @NotEmpty(message = "来源网站地址不能为空", groups = {Create.class})
    @Length(max = 100, message = "来源网站地址限制100个字符")
    private String srcSiteUrl;

    @ApiModelProperty("发布日期")
    @NotNull(message = "发布日期不能为空", groups = {Create.class})
    private Long publishTime;

    @ApiModelProperty("开标日期")
    @NotNull(message = "开标日期不能为空", groups = {Create.class})
    private Long startTime;

    @ApiModelProperty("结标日期")
    @NotNull(message = "结标日期不能为空", groups = {Create.class})
    private Long endTime;

    @ApiModelProperty("关联学校id")
    @NotEmpty(message = "关联学校不能为空", groups = {Create.class})
    private String schoolId;

    @ApiModelProperty("正文")
    @NotEmpty(message = "正文不能为空", groups = {Create.class})
    @Length(max = 65535, message = "正文限制65535个字符")
    private String content;

    @ApiModelProperty("状态")
    private BidStatus status;

    public static interface Create extends Default {

    }

}
